console.log('进入到router.js')
var fs = require('fs');
var html = fs.readFileSync('./src/page/index.html');
var add = fs.readFileSync('./src/page/add.html');
var list = fs.readFileSync('./src/page/list.html');
function getHtml(req,res,url){
    let pathname = url.pathname;
    res.writeHead(200, {
        "Content-Type": "text/html; charset=UTF-8"
    });
    if(/add/.test(pathname)){
        res.end(add)
    }if(/list/.test(pathname)){
        res.end(list)
    }else{
        res.end(html)
    }
}
module.exports = getHtml //注意啊原生nodejs支持支 module.exports 不支持export default等ES6写法
